package at.jaki.ubb.crawling.mvc.mock;

import java.util.ArrayList;
import java.util.List;

import at.jaki.ubb.crawling.model.Target;
import at.jaki.ubb.crawling.model.config.CrawlingEngineConfig;
import at.jaki.ubb.crawling.model.config.DataFinderConfig;
import at.jaki.ubb.crawling.model.config.DataFinderManagerConfig;
import at.jaki.ubb.crawling.model.config.DataTransformerConfig;
import at.jaki.ubb.crawling.model.config.DataTransformerManagerConfig;

public class MockDataGenerator {

	/**
	 * private constructor for helper class
	 */
	private MockDataGenerator() {
	}

	public static CrawlingEngineConfig createMockConfigObject1() {

		CrawlingEngineConfig cec = new CrawlingEngineConfig();

		// data finder manager config
		DataFinderManagerConfig dfmc = new DataFinderManagerConfig();
		List<DataFinderConfig> dataFinders = new ArrayList<DataFinderConfig>();

		DataFinderConfig dataFinder1 = new DataFinderConfig();
		dataFinder1.setClazzName("at.jaki.ubb.crawling.stlib.dataFinder.SimpleHttpDataFinder");
		dataFinder1.setLogName("web browser");

		dataFinders.add(dataFinder1);
		dfmc.setDataFinders(dataFinders);
		cec.setDataFinderManagerConfig(dfmc);
		
		DataTransformerManagerConfig dtmc = new DataTransformerManagerConfig();
		List<DataTransformerConfig> dataTransformers = new ArrayList<DataTransformerConfig>();
		
		DataTransformerConfig dataTransformer1 = new DataTransformerConfig();
		dataTransformer1.setClazzName("at.jaki.ubb.crawling.stlib.dataTransformer.MediafaxTransformer");
		dataTransformer1.setLogName("mediafax home transformer");
		
		
		dataTransformers.add(dataTransformer1);
		dtmc.setDataTransformers(dataTransformers);
		cec.setDataTransformerManagerConfig(dtmc);

		// other config will come here

		return cec;
	}

	public static Target<?> createMockTarget1() {
		Target<String> t = new Target<String>(1D, "001", "url", "http://www.google.com");
		return t;
	}
	
	public static Target<?> createMockTargetMediafax() {
		Target<String> t = new Target<String>(1D, "001", "url", "http://www.mediafax.ro/stiinta-sanatate/");
		return t;
	}

}
